<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>CSS基本语法</title> 
<style>
ul {
    list-style-type:none;
    margin:10px;
    padding: 0px;
    width: 200px;
    background-color: cornflowerblue;
    height: 100%;
    position: fixed;
}
li a {
    display: block;
    color: #000;
    padding: 8px 16px;
    text-decoration: none;

}
li a:hover {
    background-color: #555;
    color: white;
}
.active{
    background-color: #4CAF50;
    color: white;
}
</style>
</head>
<body>
    <ul>
        <li><a class="active" href="#home">主页</a></li>
        <li><a href="#news">新闻</a></li>
        <li><a href="#cont">联系</a></li>
        <li><a href="#abou">关于</a></li>
    </ul>
</body>
</html>

